<template>
  <div class="goods-desc">
    <h3 class="title">{{ goodsDesc.title }}</h3>

    <hr />

    <div class="content" v-html="goodsDesc.content"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: this.$route.params.id,
      goodsDesc: {}
    };
  },
  methods: {
    getGoodsDesc() {
      this.$http.get("api/goods/getdesc/" + this.id).then(result => {
        if (result.body.status === 0) {
          this.goodsDesc = result.body.message[0];
        }
      });
    }
  },
  created() {
    this.getGoodsDesc();
  }
};
</script>

<style lang="scss">
.goods-desc {
  padding: 8px;
  .title {
    font-size: 18px;
    color: #22aaff;
    text-align: center;
    margin: 12px 0;
  }
  .content {
    p {
      margin: 0;
      img {
        display: block;
        margin: 0;
        width: 100%;
      }
    }
  }
}
</style>